package com.bnq.control.desktop.xmlview;

import java.util.HashMap;
import java.util.Map;

import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;

import com.bnq.control.R;

public class KeyboardFunView extends XmlView {

	static int[] key_id = { R.id.btn_id_f1, R.id.btn_id_f2, R.id.btn_id_f3,
			R.id.btn_id_f4, R.id.btn_id_f5, R.id.btn_id_f6, R.id.btn_id_f7,
			R.id.btn_id_f8, R.id.btn_id_f9, R.id.btn_id_f10, R.id.btn_id_f11,
			R.id.btn_id_f12, R.id.btn_id_esc, R.id.btn_id_ins,
			R.id.btn_id_left, R.id.btn_id_top, R.id.btn_id_right,
			R.id.btn_id_home, R.id.btn_id_pgup, R.id.btn_id_bottom,
			R.id.btn_id_del, R.id.btn_id_end, R.id.btn_id_pgdn,
			R.id.btn_id_space };

	public KeyboardFunView(View view) {
		super(view);
	}

	@Override
	protected void onInitClickView(View rootView, OnClickListener l) {
		super.onInitClickView(rootView, l);
	}

	@Override
	protected void onInitTouchView(View rootView, OnTouchListener l) {
		super.onInitTouchView(rootView, l);
		View v;
		for (int i = 0; i < key_id.length; i++) {
			v = rootView.findViewById(key_id[i]);
			v.setOnTouchListener(l);
		}
	}

	public final static Map<Integer, String> mKey = new HashMap<Integer, String>() {
		/**
		 *
		 */
		private static final long serialVersionUID = 1L;

		{
			put(R.id.btn_id_f1, "F1");
			put(R.id.btn_id_f2, "F2");
			put(R.id.btn_id_f3, "F3");
			put(R.id.btn_id_f4, "F4");
			put(R.id.btn_id_f5, "F5");
			put(R.id.btn_id_f6, "F6");
			put(R.id.btn_id_f7, "F7");
			put(R.id.btn_id_f8, "F8");
			put(R.id.btn_id_f9, "F9");
			put(R.id.btn_id_f10, "F10");
			put(R.id.btn_id_f11, "F11");
			put(R.id.btn_id_f12, "F12");
			put(R.id.btn_id_esc, "ESCAPE");
			put(R.id.btn_id_ins, "INSERT");
			put(R.id.btn_id_left, "LEFT");
			put(R.id.btn_id_top, "UP");
			put(R.id.btn_id_right, "RIGHT");
			put(R.id.btn_id_home, "HOME");
			put(R.id.btn_id_pgup, "PRIOR");
			put(R.id.btn_id_bottom, "DOWN");
			put(R.id.btn_id_del, "DELETE");
			put(R.id.btn_id_end, "END");
			put(R.id.btn_id_pgdn, "NEXT");
			put(R.id.btn_id_space, "SPACE");
		}
	};
}
